package main

import "fmt"

func main()  {
	//定义一个channel
	c := make(chan int)

	go func() {
		defer fmt.Println("goroutine 结束。。")
		fmt.Println("goroutine 正在运行")

		c <- 666 //将666发送给c
	}()

	num := <- c //从c接收数据，并且赋值给C

	fmt.Println("num = ",num)
	fmt.Println("main goroutine结束..")
}
